home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / Peon / PeonSDK-Win32-1.0.0.exe / {app} / PeonMain / include / IApplicationState.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-11-17  |  1.9 KB  |  76 lines

  1.  
  2. #ifndef __IAPPLICATIONSTATE_H_
  3. #define __IAPPLICATIONSTATE_H_
  4. /*
  5. Peon - Win32 Games Programming Library
  6. Copyright (C) 2002-2005 Erik Yuzwa
  7.  
  8. This library is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU Library General Public
  10. License as published by the Free Software Foundation; either
  11. version 2 of the License, or (at your option) any later version.
  12.  
  13. This library is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16. Library General Public License for more details.
  17.  
  18. You should have received a copy of the GNU Library General Public
  19. License along with this library; if not, write to the Free
  20. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.  
  22. Erik Yuzwa
  23. peon AT wazooinc DOT com
  24. */
  25.  
  26. #include "IUnknown.h"
  27.  
  28. namespace peon
  29. {
  30.     /**
  31.     * This base object is responsible for containing everything and anything
  32.     * that belongs in its own state during the lifetime of the game.
  33.     */
  34.     class PEONMAIN_API IApplicationState : public IUnknown
  35.     {
  36.     public:
  37.         /**
  38.         * Constructor
  39.         */
  40.         IApplicationState(){}
  41.  
  42.         /**
  43.         * Destructor
  44.         */
  45.         virtual ~IApplicationState(){}
  46.  
  47.         /**
  48.         * This method is launched when we want to load up and create everything
  49.         * within this state.
  50.         * @return bool - true if ok
  51.         */
  52.         virtual bool onLoad() = 0;
  53.  
  54.         /**
  55.         * This method is launched when its time to cleanup and free any
  56.         * allocated memory for this state
  57.         */
  58.         virtual void onUnload() = 0;
  59.  
  60.         /**
  61.         * This method is launched when the engine signals the chance to
  62.         * update this state 
  63.         * @param fElapsedTime - the delta used for calculating object movement
  64.         */
  65.         virtual void onUpdate( float fElapsedTime ) = 0;
  66.  
  67.         /**
  68.         * This method is responsible for processing any rendering commands
  69.         * for this state
  70.         */
  71.         virtual void onRender(){}
  72.     };
  73. }
  74.  
  75. #endif
  76.